Skip to content

fix(jobs): give the bulk bar separate retry and discard all-matching buttons - #2

Merged
cmer merged 1 commit into
mainfrom
fix/bulk-job-discard
Jul 28, 2026
Merged

fix(jobs): give the bulk bar separate retry and discard all-matching buttons#2
cmer merged 1 commit into
mainfrom
fix/bulk-job-discard

Conversation

@cmer

@cmer cmer commented Jul 28, 2026

Copy link
Copy Markdown
Owner

Summary

  • The failed-jobs selection bar is one form posting to bulk_retry_jobs_path; "Discard selected" overrides the target with formaction. The neutral "or apply to all N matching" button carried no formaction, so it inherited the form action and always retried — discarding all matching was unreachable from the bulk bar, and clicking it after intending a discard silently retried every matching job.
  • Replaced that single button with explicit Retry all and Discard all buttons in app/views/flightdeck/jobs/_list.html.erb, the latter carrying the discard formaction and a destructive confirm. Both keep name="scope" value="all" so ActionsController#act_on_all_matching re-runs the filter server-side rather than trusting posted ids.
  • Added a .fd-bulkbar-all label style for the new "or all N matching:" prefix, and rebuilt the committed CSS digest (rake assets:build).
  • Added a regression test asserting every destructive button in the bulk bar posts to /jobs/discard, and that exactly one of the two scope=all buttons falls through to the form's retry action.

No controller changes: RetriesController and DiscardsController were already correctly separated — this was purely a markup wiring bug.

Testing

  • bin/test — asset freshness plus the fast suite in both host modes (262 runs, 971 assertions, 0 failures each)
  • bundle exec rubocop — 85 files, no offenses
  • bundle exec rake assets:build — CSS/JS rebuilt and committed
  • Manual check against bin/demo on the seeded dummy app: verified the two buttons render and target the retry and discard endpoints respectively

…buttons

The failed-jobs selection bar is a single form posting to the bulk retry
endpoint, with "Discard selected" overriding the target via formaction. The
neutral "or apply to all N matching" button carried no formaction, so it
inherited the form action and always retried — there was no way to discard
all matching from the bulk bar, and clicking it after intending a discard
silently retried every matching job.

Split it into explicit "Retry all" and "Discard all" buttons, the latter
carrying the discard formaction and a destructive confirm. Both keep
scope=all so the server re-runs the filter rather than trusting posted ids.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@cmer
cmer merged commit 7d01cd5 into main Jul 28, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant